package com.labichaoka.chaoka.ui.record;

import android.support.v4.view.ViewPager;
import android.os.Bundle;

import com.labichaoka.chaoka.R;
import com.labichaoka.chaoka.base.BaseActivity;
import com.labichaoka.chaoka.ui.record.borrow.BorrowFragment;
import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems;

import butterknife.BindView;

public class BorrowRecordActivity extends BaseActivity {
    @BindView(R.id.viewPager)
    ViewPager viewPager;
    @BindView(R.id.tab)
    SmartTabLayout tab;

    @Override
    protected int initLayoutId() {
        return R.layout.activity_borrow_record;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {
        FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
                getSupportFragmentManager(), FragmentPagerItems.with(mContext)
                .add("借款记录", BorrowFragment.class)
                .add("还款记录", RepayFragment.class)
                .create());

        viewPager.setAdapter(adapter);

        tab.setViewPager(viewPager);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
}
